#!/bin/sh

# root mount point
RMPOINT=/mnt/media

# specific mount point
SMPOINT=$RMPOINT/$1

# mount cmd
UMOUNT_DEV="umount -l $RMPOINT/$1"

sync

case $1 in
	"sd"[a-z][0-9]|"sd"[a-z]|"mmcblk"[0-9]|"mmcblk"[0-9]"p"[0-9])
		$UMOUNT_DEV
		rm -rf $SMPOINT;;
	*)
		echo "device $1 is unknown."
		exit;;
esac


